home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_parachute.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  262 lines

  1. # Jones 3D Cog Script
  2. #
  3. # Riv_Parachute.cog
  4. #
  5. # This is the opening cutscene wherein Indy parachutes into the level.
  6. #
  7. # [PAZ] && [TRM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. #========================================================================================
  11.  
  12. symbols
  13.  
  14.     message        startup
  15.     message        user0
  16.     
  17.     thing        player                            local #duh...
  18.     thing        chuteindy                        #actor w/ chute
  19.     thing        chutetarget                        #target for chuteindy
  20.     thing        chutetarg2                        #where indy steps to while the chute drops
  21.     thing        chutetarg3                        #where chuteindy lines up after keyframes are done
  22.     thing        cam1                            #1st cutscene cam
  23.     thing        camtarget1                        #target for cam1's focus
  24.     thing        cam2                            #2nd cs camera
  25.     thing        camtarget2                        #2nd cam focus
  26.     thing        cam3                            #3rd cam
  27.     thing        camtarget3                      #3rd cam focus
  28.      thing        rock                            #ghost thing where the rockw/chute will be created
  29.     thing       chute
  30.     thing        chutelooktarg                    #thing the chute actor looks at
  31.     thing        camspot                            #place the cam interps to
  32.     thing        plane                            #da plane! da plane!
  33.     thing       fadePlate
  34.     thing       fadePlate2
  35.     
  36.     template    tpl_Chute=rockchute                local
  37.     template    tpl_Rock=chute4rock             local
  38.     
  39.     keyframe    flail=0in_chute.key                local    #indy's animations while he drops
  40.     keyframe    land=0in_chute_land.key            local    #landing animation
  41.     keyframe    remove=0in_chute_remove.key        local    #removing the harness
  42.     
  43.     sound       snd_Plane=riv_intro_plane_c.wav local
  44.     sound        crunch=fol_in_landsnow.wav        local    #landing noise
  45.     sound        rstep=fol_in_rrunsnow.wav        local    #r step
  46.     sound        oomf=inxj016g.wav                local    #Indy says "oomf"
  47.     sound        tunes=mus_riv_intro.wav            local    #intro tunes
  48.     sound        whoosh=riv_parachute_whoosh.wav    local    #parachute whooshes past camera
  49.     sound        ruffle=riv_parachute_ruffle.wav    local    #parachute ruffles on ground
  50.     sound        undo=riv_parachute_unfasten.wav    local    #unfastens parachute
  51.     sound       sfx_FootFall=fol_in_landsnow.wav    local   # landing in snow
  52.     
  53.     # ** subroutines **
  54.     flex        landing     local
  55.     flex        ending      local
  56.     
  57.     int            start=0            local                    #int to see if the cutscene has played
  58.     int            tracknumber        local                    #return of the current keyframe track #
  59. #    int         dontPlay=1      local
  60.  
  61.     int            bSeen=0            local
  62.     
  63. end
  64.  
  65. #========================================================================================
  66.     
  67. code
  68.  
  69. startup:
  70.  
  71.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  72.  
  73.     Sleep(0.001); # Let engine get set up
  74.  
  75.     # switch to cam1
  76.     SetCameraLookInterp(2, 0);
  77.     SetCameraPosInterp(2, 0);
  78.     SetCameraFocus(2, cam1);
  79.     SetCameraSecondaryFocus(2, camtarget1);
  80.     SetCurrentCamera(2);
  81.     SetCameraFOV(90, 0, 0);
  82.  
  83.     return;
  84.  
  85. # ..............................................................................
  86.  
  87. user0: # RT: Indicates that autosave/restore has completed...
  88.  
  89.     if (bSeen) return; # RT
  90.     bSeen = 1;
  91.  
  92.     # switch to cam1
  93.     SetCameraLookInterp(2, 0);
  94.     SetCameraPosInterp(2, 0);
  95.     SetCameraFocus(2, cam1);
  96.     SetCameraSecondaryFocus(2, camtarget1);
  97.     SetCurrentCamera(2);
  98.     SetCameraFOV(90, 0, 0);
  99.  
  100.     player = GetLocalPlayerThing();
  101.  
  102.     #turn on fog
  103.     SetFog(1, '0.5 0.5 0.6', 10, 350);
  104.     
  105.     #if(dontPlay == 1) return;
  106.     
  107.     # disable controls
  108.     StartCutscene(2);    
  109.     SetActorFlags(player, 0x200000);
  110.     
  111.     # pre-load some junk
  112.     ClearThingFlags(chuteindy, 0x80000);
  113.     PlaySoundLocal(tunes, 0.0, 0.0, 0x0, 0);
  114.     Sleep(0.01);
  115.     SetThingFlags(chuteindy, 0x80000);
  116.     
  117.     #turn off fog to see plane
  118.     SetFog(0, '0.5 0.5 0.6', 10, 350);
  119.     
  120.     # add some light to da plane
  121.     SetThingLight(plane, '0.5 0.5 0.5', 0.001, 0.1);
  122.  
  123.     # turn on look interp
  124.     SetCameraLookInterp(2, 0);
  125.     SetCameraPosInterp(2, 0);
  126.     
  127.     # Disable and hide player
  128.     SetThingFlags(player, 0x80000);
  129.     SetThingFlags(chuteindy, 0x80000);
  130.  
  131.     # fade in
  132.     ThingFadeAnim(fadePlate, 1, 0, 2.0, 0);
  133.     DestroyThing(fadePlate2);
  134.     
  135.     #c-47 cruises thru frame
  136.     MoveToFrame(plane, 1, 25);
  137.     MoveToFrame(camtarget1, 1, 0.5);
  138.     
  139.     Sleep(1.0);
  140.     
  141.     PlaySoundLocal(snd_Plane, 1.0, 0.0, 0x0, 0);
  142.     
  143.     Sleep(6.0);
  144.     
  145.     #get the keys track number
  146.     tracknumber=PlayKey(chuteindy, flail, 0, 0x00000001, 0);
  147.     
  148.     # reveal and float chuteindy to ground
  149.     SetThingMaxRotVel(chuteindy, 30);
  150.     ClearThingFlags(chuteindy, 0x80000);
  151.         
  152.     #tunes kick in
  153.     PlaySoundLocal(tunes, 1.0, 0.0, 0x0, 0);
  154.     
  155.     AISetMoveSpeed(chuteindy, 6.0);
  156.     AISetMoveThing(chuteindy, chutetarget, 0);
  157.     Sleep(0.01);
  158.             
  159.     # Re-set FOV (pan in) as Indy comes at you
  160.     SetCameraFOV(70, 1, 7.0);
  161.     
  162.     #sleep 'til indy's close enough, then turn him
  163.     Sleep(3.5);
  164.     AISetLookThing(chuteindy, chutelooktarg);
  165.     
  166.     # wait for the chute get close enough
  167.     Sleep(1.5);
  168.     
  169.     #play sound
  170.     PlaySoundLocal(whoosh, 1.0, 0, 0x0000, 0);
  171.     Sleep(1.6);
  172.     
  173.     #turn on fog
  174.     SetFog(1, '0.5 0.5 0.6', 10, 350);
  175.     
  176.     Call landing;
  177.     
  178.     #destroy plane
  179.     DestroyThing(plane);
  180.     
  181.     Call ending;
  182.     
  183.     #reset cutscene cam
  184.     SetCameraPosInterp(2, 0);
  185.     SetCameraLookInterp(2, 0);
  186.         
  187.     return;
  188.  
  189. #........................................................................................
  190.  
  191. landing:   
  192.     
  193.     # quick cut to cam2 
  194.     
  195.     SetCameraFOV(90, 0, 0); 
  196.     Sleep(0.01);
  197.     SetCameraLookInterp(2, 0); 
  198.     SetCameraSecondaryFocus(2, camtarget2);
  199.     SetCameraFocus(2, cam2);
  200.     Sleep(0.01);
  201.  
  202.     # Indy lands<oomf>, chute drops on rock...
  203.     PlaySoundLocal(oomf, 0.5, 0, 0x0000, 0);
  204.     PlaySoundLocal(sfx_FootFall, 1.0, 0, 0x0000, 0);
  205.     AIWaitForStop(chuteindy);  
  206.     #AISetMoveThing(chuteindy, chutetarg2, 1);
  207.     StopKey(chuteindy, tracknumber, 0);
  208.     PlayKey(chuteindy, land, 7, 0x12, 0);
  209.     PlaySoundLocal(ruffle, 1.0, 0, 0x0000, 0);
  210.     
  211.     SetHorizonSkyOffset('0.0 0.95 0.0');
  212.     
  213.     #sleep long enough for the chute to pass the camera, then pan in
  214.     Sleep(1.2);
  215.     SetCameraFOV(15, 1, 1.0);
  216.     
  217.     #sleep 'til end of landing animation
  218.     Sleep(0.5);
  219.     PlaySoundLocal(ruffle, 1.0, 0, 0x0000, 0);
  220.      
  221.     #indy steps out of harness
  222.     PlayKey(chuteindy, remove, 7, 0x12, 0);
  223.     Sleep(0.25);
  224.     PlaySoundLocal(undo, 0.7, 0, 0x0000, 1);
  225.     Sleep(0.1);
  226.     PlaySoundLocal(rstep, 1.0, 0, 0x0000, 0);  
  227.     
  228.     #create chute and rock
  229.     CreateThing(tpl_Chute, chute);
  230.     CreateThing(tpl_Rock, rock);
  231.        
  232.     return;
  233.     
  234. #........................................................................................
  235.     
  236. ending:
  237.                
  238.     #Set camera 1 offset to thing    
  239.     SetCameraPosition(1, GetThingPOS(cam3));
  240.     
  241.     #reset cam2's FOV
  242.     ResetCameraFOV(0, 0.0);
  243.     
  244.     #destroy chuteindy, show player
  245.     DestroyThing(chuteindy);
  246.     ClearThingFlags(player, 0x80000); # player visible
  247.     
  248.     #cam swings into place
  249.     SetCurrentCamera(1);
  250.  
  251.     # player in control
  252.     ClearActorFlags(player, 0x200000);
  253.     Sleep(0.01);
  254.     
  255.     #the end
  256.     EndCutscene();
  257.     
  258.     return;
  259.                 
  260.     
  261. end
  262.